'use strict';

const prefix_api = '/api';
/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.resources(`storage`, `${prefix_api}/storage`, controller.storage);
  router.resources(`person`, `${prefix_api}/database/person`, controller.database.person);
  // 非api开头的都传网站
  router.get(new RegExp(`^(?!${prefix_api}).*$`), controller.home.index);
};
